<template>
	<view class="progress">
		<view class="p-r-20 c-33" :style="{fontSize:`${lineFontSize}rpx`}">{{current}}/{{total}}{{unitName}}</view>
		<u-line-progress :percentage="percentage" :height="lineHeiht"></u-line-progress>
	</view>
</template>

<script>
	export default {
		name: "cx-scan-progress",
		props: {
			size: {
				type: String,
				default: "normal"
			},
			current: {
				type: [String, Number],
				default: 0
			},
			unitName: {
				type: [String],
				default: ""
			},
			total: {
				type: [String, Number],
				default: 0
			},
			lineFontSize: {
				type: [Number],
				default: 38
			},
			// 线条高度
			lineHeiht: {
				type: [Number],
				default: 20
			}
		},
		computed: {
			percentage: function() {
				const total = Number(this.total)
				const current = Number(this.current)
				if (total === 0) return 0
				return this.$amount((Number(current) / Number(total)) * 100).format()
			}
		},
		data() {
			return {

			}
		}
	}
</script>

<style scoped>
	.progress {
		background: #fff;
		display: flex;
		align-items: center;
	}
</style>
